import Vue from "vue";
import VueRouter from "vue-router";


Vue.use(VueRouter);

const routes = [
  {
    path: "/", // url路径"/"代表首页，http://localhost:8080/
    redirect: "/login"
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/pages/login")
  },
  {
    path: "/index",
    name: "index",
    component: () => import("@/pages/index"),
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("@/pages/home"),
        children:[]
      },
      {
        path: "/courseManage",
        name: "courseManage",
        component: () => import("@/pages/file/courseManage")
      },
      {
        path: "/classManage",
        name: "classManage",
        component: () => import("@/pages/file/classManage")
      },
      {
        path: "/teacherManage",
        name: "teacherManage",
        component: () => import("@/pages/file/teacherManage")
      },
      {
        path: "/studentManage",
        name: "studentManage",
        component: () => import("@/pages/file/studentManage")
      },
      {
        path: "/libraryManage",
        name: "questionManage",
        component: () => import("@/pages/file/libraryManage")
      },
      {
        path: "/paperManage",
        name: "paperManage",
        component: () => import("@/pages/file/paperManage")
      },
      {
        path: "topic",
        name: "topic",
        component: () => import("@/pages/file/topic")
      },
      {
        path: "questionManage",
        name: "questionManage",
        component: () => import("@/pages/file/questionManage")
      },
    ]
  }
];


const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});

export default router;
